package com.pansoft.generator;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.IFill;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.sql.Types;
import java.util.AbstractList;
import java.util.Collections;

@SpringBootApplication
public class GeneratorApplication {

    /*public static void main(String[] args) {
        SpringApplication.run(GeneratorApplication.class, args);
    }
*/
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:kingbase8://192.168.254.109:54321/cmdata_kp?currentSchema=cm_kp", "cm_kp", "king##88CCDD")
                .globalConfig(builder -> {
                    builder.author("baomidou") // 设置作者
                            .enableSwagger() // 开启 swagger 模式
                            .outputDir("D:\\generator\\src\\main\\java\\com\\pansoft\\generator\\code\\"); // 指定输出目录
                })
                .packageConfig(builder -> builder
                        .parent("com.baomidou.mybatisplus")
                        .entity("entity")
                        .mapper("mapper")
                        .service("service")
                        .serviceImpl("service.impl")
                        .xml("mapper.xml")
                )
                .strategyConfig(builder -> builder
                        .addInclude("sw_dct_fpztzd")
                        .entityBuilder()
                        .enableLombok()
                )
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }

}
